package it.omnisong.client.widget;

import it.omnisong.client.resources.Resources;

import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.google.gwt.user.client.ui.AbstractImagePrototype;

public class SearchPanel extends TabPanel {
	
	final SearchPanel self = this;
	
	private TabItem basicSearchTab;
	private TabItem advancedSearchTab;
	
	final BasicSearchPanel basicSearchPanel = new BasicSearchPanel();
	
	public SearchPanel() {
		
		this.self.setPixelSize(600, 50);
		
		/* inizializzo il tab per la basic search */
		this.basicSearchTab = new TabItem("Basic Search");
		this.basicSearchTab.setIcon(AbstractImagePrototype.create(Resources.ICONS.basicSearch()));
		this.basicSearchTab.setToolTip("Puoi cercare un cantante o un gruppo; una canzone o un testo!");
		this.basicSearchTab.add(this.basicSearchPanel);
			
		/* inizializzo il tab per la advanced search */
		this.advancedSearchTab = new TabItem("Advanced Search");
		this.advancedSearchTab.setIcon(AbstractImagePrototype.create(Resources.ICONS.advancedSearch()));
		this.advancedSearchTab.setToolTip("Fai una ricerca avanzata");
		
		/* aggiungo i tab item a questo tabPanel */
		this.self.add(this.basicSearchTab);
		this.self.add(this.advancedSearchTab);
	}

	public void addResultPanel(ResultPanel resultPanel) {
		/* aggiungo il result panel ai search panel */
		this.basicSearchPanel.addResultPanel(resultPanel);
	}
	

}
